import React, { Component } from 'react';
import '../css/Niubi.less';
import {observer} from "mobx-react";
import  Mobx from  '../mobx'
import  axios from  'axios'
@observer class Niubi extends Component {
    constructor(props) {
        super(props)
        this.state={
            niubi:''
        }
    }
    componentDidMount(){
        Mobx.history= this.props.history
        axios.get('http://www.niuduxiu.com/pc/personPage/personInfo.jhtml?id='+Mobx.zhanghao)
            .then((item)=>{
                this.setState({
                    niubi:item.data.date.point
                })
            })
    }
    toSubmit(){
        Mobx.history.push('/Submit')
    }
    render() {
        return (
            <div className="Niubi">
                <div className='Header'>
                    <p className='title'>牛币中心</p>
                    <div className='Circle'>
                        <div >
                            <div>
                                <div>
                                    <p>{this.state.niubi}</p>
                                    <p>牛币</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div className='getPoint'>
                    <p>获取牛币</p>
                    <p>上传作品，赢取牛币+100 <span onClick={this.toSubmit.bind(this)}>去上传</span></p>
                </div>
            </div>
        );
    }
}

export default Niubi;
